<template>
	<view>
		<u-swiper :list="bannerlist" previousMargin="30" nextMargin="30" circular :autoplay="true" radius="5"
			bgColor="#ffffff"></u-swiper>
		<u-gap height="10" bgColor="#fac018"></u-gap>
		<u-divider></u-divider>
		<view>
			<u-list @scrolltolower="scrolltolower">
				<u-list-item v-for="(item, index) in socialList" :key="index">
					<view style="right: 10px;margin-top: 10px;">
						<!-- todo  显示发布用户的名字与头像 -->
						<u--image :showLoading="true" :src="item.socialImage" width="50px" height="50px"
							@click="sureOrder">
						</u--image>
						<u--text :text="item.socialBelongtoUser"></u--text>
					</view>
					<view style="position: absolute;right: 10px;width: 300px;;">
						<!-- <u--text :text="item.socialContent">
						</u--text> -->
						<text class="u-line-3">{{item.socialContent}}
						</text>
					</view>
					<view style="right: 10px;position: absolute;margin-top: 70px;">
						<u--text :text="item.socialCreateTime" color='#4ccfbc'></u--text>
					</view>

					<u-gap height="30" bgColor="#fff"></u-gap>
				</u-list-item>
			</u-list>
		</view>
		<view style="position: fixed;width: 100%;bottom: 60px;">
			<u-button text="上传动态" color="linear-gradient(to right, rgb(190, 190, 190), rgb(56, 181, 255))"
				@click="addSocial"></u-button>
		</view>
	</view>
</template>

<script>
	import {
		getAllSocial
	} from '@/config/api.js'
	export default {
		data() {
			return {
				bannerlist: [
					'https://cdn.colorhub.me/U_fiaUBBUv9PjfUT7bXRyHcfrb_TNKcr3Zoky4Zc8iU/rs:auto:280:0:0/g:ce/bG9jYWw6Ly8vYzAv/MjAvMDJmMzRmZmVj/ZGE2MGNiNDA2NzQ5/NTczOGQwYTYyMTAz/YjNkYzAyMC5qcGc.jpg',
					'https://cdn.colorhub.me/YHJJlP-2Y2AuiXn0GFLTXQ0X61jgwwCQFoSoaQAMqI0/rs:auto:280:0:0/g:ce/bG9jYWw6Ly8vOGEv/NzcvZDg5MGFhMjE2/ZjExMGRlYWZkMjc0/YmJmMzFhZWY3YmQy/Y2Q5OGE3Ny5qcGc.jpg',
					'https://cdn.colorhub.me/YlleW42FeMR6lkPiBvK1vmJ_SH22_loRLuvpsfiqAvk/rs:auto:280:0:0/g:ce/bG9jYWw6Ly8vNWMv/MmYvYTVhMWIwOWVh/ODk5ZDYwZGQ1ZTZk/NTU1YWU5NGZlNjM3/YzBjNWMyZi5qcGVn.jpg'
				],
				socialList: []
			}
		},
		mounted() {
			this.getAllSociallist()
		},
		methods: {
			addSocial() {
				uni.navigateTo({
					url: 'upSocial/upSocial'
				})
			},
			getAllSociallist() {
				getAllSocial({}).then((res) => {
					console.log(res);
					this.socialList = res.list
				}).catch((error) => {
					console.log(error);
				})
			}
		}
	}
</script>

<style>

</style>
